﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StockMonitor.Business
{
    /// <summary>
    /// 业务类工厂，用于生产各种提供程序
    /// </summary>
    /// <remarks>
    /// 代码编写：<author>LANCEZHANG-PC\zhangxl</author><br/>
    /// 编写时间：<datetime>2012-10-16 4:42 PM</datetime>
    /// </remarks>
    public class BusinessFactory
    {
        /// <summary>
        /// 获取当前价格提供程序.
        /// </summary>
        /// <returns>当前价格提供程序</returns>
        /// <remarks>
        /// 代码编写：<author>LANCEZHANG-PC\zhangxl</author><br/>
        /// 编写时间：<datetime>2012-10-16 4:42 PM</datetime>
        /// </remarks>
        public static ICurrentPriceProvider GetCurrentPriceProvider()
        {
            return new DBFPriceProvider();
        }

        /// <summary>
        /// 获取历史价格提供程序.
        /// </summary>
        /// <returns>历史价格提供程序</returns>
        /// <remarks>
        /// 代码编写：<author>LANCEZHANG-PC\zhangxl</author><br/>
        /// 编写时间：<datetime>2012-10-16 4:42 PM</datetime>
        /// </remarks>
        public static IHistoryPriceProvider GetHistoryPriceProvider()
        {
            return new FtpHistoryPriceProvider();
        }

        /// <summary>
        /// 获取MA计算器. 随后别忘了Init，good luck!
        /// </summary>
        /// <returns>MA计算器</returns>
        /// <remarks>
        /// 代码编写：<author>LANCEZHANG-PC\zhangxl</author><br/>
        /// 编写时间：<datetime>2012-10-16 4:42 PM</datetime>
        /// </remarks>
        public static ICaptialCalculator GetMACalculator()
        {
            return new MACalculator();
        }

        /// <summary>
        /// Gets the ETF price provider.
        /// </summary>
        /// <returns></returns>
        /// <remarks>
        /// 代码编写：<author>LANCEZHANG-PC\zhangxl</author><br/>
        /// 编写时间：<datetime>2012-10-25 5:33 PM</datetime>
        /// </remarks>
        public static IETFPriceProvider GetETFPriceProvider()
        {
            return ETFPriceProvider.Instance;
        }

        /// <summary>
        /// 获取ETFMA计算器. 随后别忘了Init，good luck!
        /// </summary>
        /// <returns>MA计算器</returns>
        /// <remarks>
        /// 代码编写：<author>LANCEZHANG-PC\zhangxl</author><br/>
        /// 编写时间：<datetime>2012-10-16 4:42 PM</datetime>
        /// </remarks>
        public static ETFMACalculator GetETFMACalculator()
        {
            return new ETFMACalculator();
        }
    }
}
